package com.medical.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import com.medical.mapper.HospitalunitpriceMapper;
import com.medical.mapper.HospitalunitpriceMapperCustom;
import com.medical.po.Hospitalunitprice;
import com.medical.po.HospitalunitpriceCustom;
import com.medical.service.HospitalunitpriceService;

/** 
* @author  LTT-AH-ZY
* @date 创建时间：2017年8月21日 上午11:10:55 
* @version 1.0 
* @parameter 参数及其意义
* @since 最早使用该方法/类/接口的JDK版本 
* @since  
* @return  
*/

public class HospitalunitpriceServiceImpl implements HospitalunitpriceService{
	@Autowired
	private HospitalunitpriceMapper hospitalunitpriceMapper;
	@Autowired
	private HospitalunitpriceMapperCustom hospitalunitpriceMapperCustom;
	@Override
	public int InsertUnitprice(HospitalunitpriceCustom hospitalunitpriceCustom) throws Exception {
		// isert a list into hospitalunitprice
		return hospitalunitpriceMapperCustom.insertSelectiveReturnID(hospitalunitpriceCustom);
	}
	@Override
	public List<HospitalunitpriceCustom> getHospitalunitpriceList(HospitalunitpriceCustom hospitalunitpriceCustom)
			throws Exception {
		// select list from hospitalunitprice by hospid
		return hospitalunitpriceMapperCustom.getHospitalunitpriceList(hospitalunitpriceCustom);
	}
	@Override
	public Hospitalunitprice getHospitalunitpriceById(Integer unitpriceid) throws Exception {
		// select * from hospitalunitprice by unitpriceid
		return hospitalunitpriceMapper.selectByPrimaryKey(unitpriceid);
	}
	@Override
	public int UpdateHospitalunitprice(Integer unitpriceid, Hospitalunitprice hospitalunitprice) throws Exception {
		// update table hospitalunitprice by unitpriceid
		hospitalunitprice.setUnitpriceid(unitpriceid);
		return hospitalunitpriceMapper.updateByPrimaryKeySelective(hospitalunitprice);
	}
}
